layui.use(['rate'],function () {
    var rate = layui.rate;
    //只读
    rate.render({
        elem: '.test9'
        ,value: 4.5
        ,readonly: true
        ,half: true
        ,theme: '#ff6633'
    });
});



$(".summaryfilter-wrapper").click(function (event) {
    var ele=event.target;
    var aEle=ele.parentElement.parentElement.children;
    for (var i=0;i<aEle.length;i++){
        aEle[i].firstElementChild.classList.remove("chekboxed");
    }
    ele.parentElement.firstElementChild.classList.add("chekboxed");
});
$(".con").click(function (event) {
    var ele=event.target;
    if(ele.style[0]==null){
        ele.style.backgroundImage="url('../images/shop_img/collect1.svg')";
    }
    else{
        ele.removeAttribute("style");
    }
});
$(".praise-number").click(function (event) {
    var ele=event.target;
    var iEle=ele.parentElement.firstElementChild;
    if(ele.className=='pla'){
        iEle=ele.parentElement.parentElement.firstElementChild;
    }
    if(iEle.style[0]==null){
        iEle.style.display="inline-block";
        var a=parseInt(iEle.parentElement.children[1].firstElementChild.innerText);
        iEle.parentElement.children[1].firstElementChild.innerText=a+1;
    }
    else{
        iEle.removeAttribute("style");
        var a=parseInt(iEle.parentElement.children[1].firstElementChild.innerText);
        iEle.parentElement.children[1].firstElementChild.innerText=a-1;
    }
});
layui.use(['laypage', 'layer'], function() {
    var laypage = layui.laypage
        , layer = layui.layer;

    //总页数低于页码总数
    laypage.render({
        elem: 'demo0', count: 50,theme: '#FF6633' //数据总数
    });

    document.querySelector("#demo0").onclick= function(event){
        var ele = event.target;
        console.log(  ele.innerText); //获得页码
        if(ele.nodeName =='EM'){
            //  console.log(  ele.innerText); //获得页码
        }
    }

});
